<!DOCTYPE html>
<html lang="en">
    <head>
        <title>50bus管理后台</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="/resources/admin/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/resources/admin/css/bootstrap-responsive.min.css" />
        <link rel="stylesheet" href="/resources/admin/css/unicorn.login.css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>
        <div id="logo">
            <img src="/resources/admin/img/logo.png" alt="" />
        </div>
        <div id="loginbox">            
            <form id="login_form" class="form-vertical" action="/admin/login.json" method="POST">
				<p>请输入用户名和密码</p>
                <div class="control-group">
                    <div class="controls">
                        <div class="input-prepend">
                            <span class="add-on"><i class="icon-user"></i></span><input type="text" name="email" placeholder="用户名" />
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="input-prepend">
                            <span class="add-on"><i class="icon-lock"></i></span><input type="password" name="pwd" placeholder="密码" />
                        </div>
                    </div>
                </div>
                <div class="form-actions">
                    <span class="pull-right"><input type="button" id="submit_btn" class="btn btn-inverse" value="登录" /></span>
                </div>
            </form>
        </div>
        
        <script src="/resources/admin/js/jquery.min.js"></script>  
		<script src="/resources/admin/js/unicorn.login.js"></script>
		<script type="text/javascript" src="/resources/js/jquery.form.js"></script>
		<script type="text/javascript">
		  $(function(){
			$("#submit_btn").click(function(){
				if($.trim($("input[name=email]").val()) == ""){
					alert("请输入用户名");
					return false;
				}
				if($.trim($("input[name=pwd]").val()) == ""){
					alert("请输入密码");
					return false;
				}
				formSubmit($("#login_form"));
			});
		});
		  function formSubmit(form){
		    form.ajaxSubmit({
		        dataType: "json",
		        success: function(json) 
		        {
		        	if(json.success == "true"){
		        		location.href="/admin/index.html";
		        	}else{
		        		alert(json.msg);
		        	}
		        },
		        error: function() 
		        {
		        	alert("系统错误，请重试");
		        }
		    });
		 };
		</script>

    </body>
</html>


